package com.example.dao;

import com.example.entity.Classes;
import com.example.entity.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;



@Mapper
public interface StudentDao {
    @Select("select * from student")
    List<Student> select();

    @Insert("insert into student values(#{stuno},#{stuname},to_date(#{birthday},'yyyy-mm-dd'),#{idcard},#{phone},#{classid})")
    int addStu(Student student);
@Select("select * from classes")
    List<Classes> selectC();
@Delete("delete from student where stuno=#{param1}")
    int del(String stuno);
@Select("select * from student where stuno=#{param1}")
    List<Student> findByStuno(String stuno);
@Update("update student set stuname=#{stuname},birthday=to_date(#{birthday},'yyyy-mm-dd'),phone=#{phone},classid=#{classid}" +
        "where stuno=#{stuno}")
    int updStu(Student student);

List<Student> selectLike(String stuno);
}
